@isTest(SeeAllData=true)
public class TestLeadTriggerHandler{
    private static testMethod void testInsert(){
        Test.startTest();
        Campus__c cmps = new Campus__c(Name = 'Unit Test', Active__c = True);
        cmps.recordTypeId = Schema.sObjectType.Campus__c.getRecordTypeInfosByName().get('West - Campus').getRecordTypeId();
        insert cmps;
        
        Program__c prgm = new Program__c(Name = 'Unit Test', Active__c = True);
        prgm.recordTypeId = Schema.sObjectType.Program__c.getRecordTypeInfosByName().get('West - Program').getRecordTypeId();
        insert prgm;
        
        Catalog__c ctlg = new Catalog__c(Catalog_Name__c = 'Unit Test', 
                                            Active__c = True, Campus__c = cmps.Id, Program__c = prgm.Id);
        ctlg.X3_Payments__c = true;
        ctlg.X4_Payments__c = true;
        ctlg.X5_Payments__c = true;
        ctlg.X10_Payments__c = true;
        ctlg.X11_Payments__c = true;
        ctlg.X12_Payments__c = true;
        ctlg.Early_Payoff__c = true;
        ctlg.recordTypeId = Schema.sObjectType.Catalog__c.getRecordTypeInfosByName().get('West').getRecordTypeId();
        insert ctlg;
        
        List<Tenants__C> tenantList = Tenants__c.getall().values();
        
        Lead ld = new Lead();
        ld.LastName = 'Test';
        ld.FirstName = 'Unit';
        ld.Phone = '1234567890';
        ld.Email = 'unit@test.method';
        ld.Home_Phone__c = '1234567890';
       // ld.Campus__c = cmps.Id;
        //ld.Program__c = prgm.Id;
        //ld.Catalog__c = ctlg.Id;
        ld.Country = 'United States';
        ld.recordTypeId = Schema.sObjectType.Lead.getRecordTypeInfosByName().get('West - Prospective Student').getRecordTypeId();
        insert ld;
        
        ld = new Lead();
        ld.LastName = 'Test';
        ld.FirstName = 'Unit';
        ld.Phone = '1234567890';
        ld.Email = 'unit@test.method';
        ld.Home_Phone__c = '1234567890';
        ld.Campus_Text__c = cmps.Name;
        ld.Program_Text__c = prgm.Name;
        //ld.Catalog__c = ctlg.Id;
        //ld.Country_of_Birth_Text__c = 'Mexico';
        //ld.Country_of_Residence_Text__c = 'Mexico';
        ld.Enrollment_Counselor_Lead_Finder_Text__c = 'Arpan Patel';
        ld.Campaign_Text__c = 'CN2907';
        ld.recordTypeId = Schema.sObjectType.Lead.getRecordTypeInfosByName().get('West - Prospective Student').getRecordTypeId();
        ld.campus__C = cmps.id;
        ld.Country = 'United States';
        ld.program__C = prgm.id;
        insert ld;
        Test.stopTest();
    }

    private static testMethod void testUpdate(){
        
        Campus__c cmps = new Campus__c(Name = 'Unit Test', Active__c = True);
        cmps.recordTypeId = Schema.sObjectType.Campus__c.getRecordTypeInfosByName().get('West - Campus').getRecordTypeId();
        insert cmps;
        
        Program__c prgm = new Program__c(Name = 'Unit Test', Active__c = True);
        prgm.recordTypeId = Schema.sObjectType.Program__c.getRecordTypeInfosByName().get('West - Program').getRecordTypeId();
        insert prgm;
        
        Catalog__c ctlg = new Catalog__c(Catalog_Name__c = 'Unit Test', 
                                            Active__c = True, Campus__c = cmps.Id, Program__c = prgm.Id);
        ctlg.X3_Payments__c = true;
        ctlg.X4_Payments__c = true;
        ctlg.X5_Payments__c = true;
        ctlg.X10_Payments__c = true;
        ctlg.X11_Payments__c = true;
        ctlg.X12_Payments__c = true;
        ctlg.Early_Payoff__c = true;
        ctlg.recordTypeId = Schema.sObjectType.Catalog__c.getRecordTypeInfosByName().get('West').getRecordTypeId();
        insert ctlg;
        
        List<Tenants__C> tenantList = Tenants__c.getall().values();
        
        Lead ld = new Lead();
        ld.LastName = 'Test';
        ld.FirstName = 'Unit';
        ld.Phone = '1234567890';
        ld.Email = 'unit@test.method';
        ld.Home_Phone__c = '1234567890';
       // ld.Campus__c = cmps.Id;
       // ld.Program__c = prgm.Id;
        //ld.Catalog__c = ctlg.Id;
        ld.Country = 'United States';
        ld.recordTypeId = Schema.sObjectType.Lead.getRecordTypeInfosByName().get('West - Prospective Student').getRecordTypeId();
        Test.startTest();
        insert ld;
        
        update ld;
        
        Test.stopTest();
    }

}